#ifndef PRECEDENCE_STACK_H_
#define PRECEDENCE_STACK_H_

#include <stdio.h>
#include <stdint.h>

#include "token_node.h"

typedef struct precedence_stack {
  token_node **stack;
  uint32_t tos;
  uint32_t ceil;
#if TEST
  uint32_t max;
#endif
} precedence_stack;

void init_precedence_stack(precedence_stack *stack, uint32_t precedence_stack_alloc_size);

void push_precedence_node_on_stack(precedence_stack *stack, token_node *token, uint32_t precedence_stack_realloc_size);

token_node *pop_precedence_node_from_stack(precedence_stack *stack);

token_node *get_precedence_stack_node_at_index(precedence_stack *stack, uint32_t index);

void free_precedence_stack(precedence_stack *stack);

#endif
